package com.ls.task.dal.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ls.fw.data.annotation.FwColumn;
import com.ls.fw.data.annotation.FwTable;
import com.ls.fw.data.bean.BaseColumns;
import com.ls.fw.data.bean.BaseDataEntity;
import com.ls.fw.data.bean.ColumnItem;
import com.ls.fw.data.converter.CustomDateSerializer;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.*;
import org.springframework.format.annotation.DateTimeFormat;

@Table(name = "sys_task_fire")
@FwTable(name = "sys_task_fire",remark = "")
public class SysTaskFire extends BaseDataEntity implements Serializable {
    /**
     * ID
     */
    @Id
    @FwColumn(name = "id",remark = "ID")
    @GeneratedValue(generator = "JDBC")
    private Long id;

    /**
     * 上级
     */
    @Column(name = "trigger_id")
    @FwColumn(name = "trigger_id",remark = "上级")
    private Long triggerId;

    /**
     * 实际执行时间
     */
    @Column(name = "fire_dt")
    @FwColumn(name = "fire_dt",remark = "实际执行时间")
    private Date fireDt;

    /**
     * 前一次实际执行时间
     */
    @Column(name = "previous_dt")
    @FwColumn(name = "previous_dt",remark = "前一次实际执行时间")
    private Date previousDt;

    /**
     * 下一次该执行时间
     */
    @Column(name = "next_dt")
    @FwColumn(name = "next_dt",remark = "下一次该执行时间")
    private Date nextDt;

    /**
     * 请求参数
     */
    @Column(name = "request_info")
    @FwColumn(name = "request_info",remark = "请求参数")
    private String requestInfo;

    /**
     * 调用服务IP
     */
    @FwColumn(name = "ip",remark = "调用服务IP")
    private String ip;

    /**
     * 调用服务标识
     */
    @Column(name = "server_flag")
    @FwColumn(name = "server_flag",remark = "调用服务标识")
    private String serverFlag;

    @Column(name = "task_id")
    @FwColumn(name = "task_id",remark = "")
    private Long taskId;

    /**
     * 计划执行时间
     */
    @Column(name = "scheduled_fire_dt")
    @FwColumn(name = "scheduled_fire_dt",remark = "计划执行时间")
    private Date scheduledFireDt;

    /**
     * 运行时间（毫秒）
     */
    @Column(name = "run_time")
    @FwColumn(name = "run_time",remark = "运行时间（毫秒）")
    private Long runTime;

    /**
     * 状态code
     */
    @Column(name = "status_code")
    @FwColumn(name = "status_code",remark = "状态code")
    private String statusCode;

    /**
     * 状态
     */
    @Column(name = "status_name")
    @FwColumn(name = "status_name",remark = "状态")
    private String statusName;

    /**
     * 执行时间
     */
    @Column(name = "do_dt")
    @FwColumn(name = "do_dt",remark = "执行时间")
    private Date doDt;

    /**
     * 完成时间
     */
    @Column(name = "complete_dt")
    @FwColumn(name = "complete_dt",remark = "完成时间")
    private Date completeDt;

    /**
     * 结果
     */
    @Column(name = "response_info")
    @FwColumn(name = "response_info",remark = "结果")
    private String responseInfo;

    private static final long serialVersionUID = 1L;

    /**
     * 获取ID
     *
     * @return id - ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置ID
     *
     * @param id ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取上级
     *
     * @return trigger_id - 上级
     */
    public Long getTriggerId() {
        return triggerId;
    }

    /**
     * 设置上级
     *
     * @param triggerId 上级
     */
    public void setTriggerId(Long triggerId) {
        this.triggerId = triggerId;
    }

    /**
     * 获取实际执行时间
     *
     * @return fire_dt - 实际执行时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonSerialize(using=CustomDateSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    public Date getFireDt() {
        return fireDt;
    }

    /**
     * 设置实际执行时间
     *
     * @param fireDt 实际执行时间
     */
    public void setFireDt(Date fireDt) {
        this.fireDt = fireDt;
    }

    /**
     * 获取前一次实际执行时间
     *
     * @return previous_dt - 前一次实际执行时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonSerialize(using=CustomDateSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    public Date getPreviousDt() {
        return previousDt;
    }

    /**
     * 设置前一次实际执行时间
     *
     * @param previousDt 前一次实际执行时间
     */
    public void setPreviousDt(Date previousDt) {
        this.previousDt = previousDt;
    }

    /**
     * 获取下一次该执行时间
     *
     * @return next_dt - 下一次该执行时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonSerialize(using=CustomDateSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    public Date getNextDt() {
        return nextDt;
    }

    /**
     * 设置下一次该执行时间
     *
     * @param nextDt 下一次该执行时间
     */
    public void setNextDt(Date nextDt) {
        this.nextDt = nextDt;
    }

    /**
     * 获取请求参数
     *
     * @return request_info - 请求参数
     */
    public String getRequestInfo() {
        return requestInfo;
    }

    /**
     * 设置请求参数
     *
     * @param requestInfo 请求参数
     */
    public void setRequestInfo(String requestInfo) {
        this.requestInfo = requestInfo == null ? null : requestInfo.trim();
    }

    /**
     * 获取调用服务IP
     *
     * @return ip - 调用服务IP
     */
    public String getIp() {
        return ip;
    }

    /**
     * 设置调用服务IP
     *
     * @param ip 调用服务IP
     */
    public void setIp(String ip) {
        this.ip = ip == null ? null : ip.trim();
    }

    /**
     * 获取调用服务标识
     *
     * @return server_flag - 调用服务标识
     */
    public String getServerFlag() {
        return serverFlag;
    }

    /**
     * 设置调用服务标识
     *
     * @param serverFlag 调用服务标识
     */
    public void setServerFlag(String serverFlag) {
        this.serverFlag = serverFlag == null ? null : serverFlag.trim();
    }

    /**
     * @return task_id
     */
    public Long getTaskId() {
        return taskId;
    }

    /**
     * @param taskId
     */
    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    /**
     * 获取计划执行时间
     *
     * @return scheduled_fire_dt - 计划执行时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonSerialize(using=CustomDateSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    public Date getScheduledFireDt() {
        return scheduledFireDt;
    }

    /**
     * 设置计划执行时间
     *
     * @param scheduledFireDt 计划执行时间
     */
    public void setScheduledFireDt(Date scheduledFireDt) {
        this.scheduledFireDt = scheduledFireDt;
    }

    /**
     * 获取运行时间（毫秒）
     *
     * @return run_time - 运行时间（毫秒）
     */
    public Long getRunTime() {
        return runTime;
    }

    /**
     * 设置运行时间（毫秒）
     *
     * @param runTime 运行时间（毫秒）
     */
    public void setRunTime(Long runTime) {
        this.runTime = runTime;
    }

    /**
     * 获取状态code
     *
     * @return status_code - 状态code
     */
    public String getStatusCode() {
        return statusCode;
    }

    /**
     * 设置状态code
     *
     * @param statusCode 状态code
     */
    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode == null ? null : statusCode.trim();
    }

    /**
     * 获取状态
     *
     * @return status_name - 状态
     */
    public String getStatusName() {
        return statusName;
    }

    /**
     * 设置状态
     *
     * @param statusName 状态
     */
    public void setStatusName(String statusName) {
        this.statusName = statusName == null ? null : statusName.trim();
    }

    /**
     * 获取执行时间
     *
     * @return do_dt - 执行时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonSerialize(using=CustomDateSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    public Date getDoDt() {
        return doDt;
    }

    /**
     * 设置执行时间
     *
     * @param doDt 执行时间
     */
    public void setDoDt(Date doDt) {
        this.doDt = doDt;
    }

    /**
     * 获取完成时间
     *
     * @return complete_dt - 完成时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonSerialize(using=CustomDateSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    public Date getCompleteDt() {
        return completeDt;
    }

    /**
     * 设置完成时间
     *
     * @param completeDt 完成时间
     */
    public void setCompleteDt(Date completeDt) {
        this.completeDt = completeDt;
    }

    /**
     * 获取结果
     *
     * @return response_info - 结果
     */
    public String getResponseInfo() {
        return responseInfo;
    }

    /**
     * 设置结果
     *
     * @param responseInfo 结果
     */
    public void setResponseInfo(String responseInfo) {
        this.responseInfo = responseInfo == null ? null : responseInfo.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysTaskFire other = (SysTaskFire) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTriggerId() == null ? other.getTriggerId() == null : this.getTriggerId().equals(other.getTriggerId()))
            && (this.getModUser() == null ? other.getModUser() == null : this.getModUser().equals(other.getModUser()))
            && (this.getModUserId() == null ? other.getModUserId() == null : this.getModUserId().equals(other.getModUserId()))
            && (this.getModDt() == null ? other.getModDt() == null : this.getModDt().equals(other.getModDt()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
            && (this.getCreateDt() == null ? other.getCreateDt() == null : this.getCreateDt().equals(other.getCreateDt()))
            && (this.getDeleteClass() == null ? other.getDeleteClass() == null : this.getDeleteClass().equals(other.getDeleteClass()))
            && (this.getValidClass() == null ? other.getValidClass() == null : this.getValidClass().equals(other.getValidClass()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getUpdateTs() == null ? other.getUpdateTs() == null : this.getUpdateTs().equals(other.getUpdateTs()))
            && (this.getInsertTs() == null ? other.getInsertTs() == null : this.getInsertTs().equals(other.getInsertTs()))
            && (this.getCanUpdate() == null ? other.getCanUpdate() == null : this.getCanUpdate().equals(other.getCanUpdate()))
            && (this.getCanDelete() == null ? other.getCanDelete() == null : this.getCanDelete().equals(other.getCanDelete()))
            && (this.getFireDt() == null ? other.getFireDt() == null : this.getFireDt().equals(other.getFireDt()))
            && (this.getPreviousDt() == null ? other.getPreviousDt() == null : this.getPreviousDt().equals(other.getPreviousDt()))
            && (this.getNextDt() == null ? other.getNextDt() == null : this.getNextDt().equals(other.getNextDt()))
            && (this.getRequestInfo() == null ? other.getRequestInfo() == null : this.getRequestInfo().equals(other.getRequestInfo()))
            && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
            && (this.getServerFlag() == null ? other.getServerFlag() == null : this.getServerFlag().equals(other.getServerFlag()))
            && (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getScheduledFireDt() == null ? other.getScheduledFireDt() == null : this.getScheduledFireDt().equals(other.getScheduledFireDt()))
            && (this.getRunTime() == null ? other.getRunTime() == null : this.getRunTime().equals(other.getRunTime()))
            && (this.getStatusCode() == null ? other.getStatusCode() == null : this.getStatusCode().equals(other.getStatusCode()))
            && (this.getStatusName() == null ? other.getStatusName() == null : this.getStatusName().equals(other.getStatusName()))
            && (this.getDoDt() == null ? other.getDoDt() == null : this.getDoDt().equals(other.getDoDt()))
            && (this.getCompleteDt() == null ? other.getCompleteDt() == null : this.getCompleteDt().equals(other.getCompleteDt()))
            && (this.getResponseInfo() == null ? other.getResponseInfo() == null : this.getResponseInfo().equals(other.getResponseInfo()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTriggerId() == null) ? 0 : getTriggerId().hashCode());
        result = prime * result + ((getModUser() == null) ? 0 : getModUser().hashCode());
        result = prime * result + ((getModUserId() == null) ? 0 : getModUserId().hashCode());
        result = prime * result + ((getModDt() == null) ? 0 : getModDt().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
        result = prime * result + ((getCreateDt() == null) ? 0 : getCreateDt().hashCode());
        result = prime * result + ((getDeleteClass() == null) ? 0 : getDeleteClass().hashCode());
        result = prime * result + ((getValidClass() == null) ? 0 : getValidClass().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getUpdateTs() == null) ? 0 : getUpdateTs().hashCode());
        result = prime * result + ((getInsertTs() == null) ? 0 : getInsertTs().hashCode());
        result = prime * result + ((getCanUpdate() == null) ? 0 : getCanUpdate().hashCode());
        result = prime * result + ((getCanDelete() == null) ? 0 : getCanDelete().hashCode());
        result = prime * result + ((getFireDt() == null) ? 0 : getFireDt().hashCode());
        result = prime * result + ((getPreviousDt() == null) ? 0 : getPreviousDt().hashCode());
        result = prime * result + ((getNextDt() == null) ? 0 : getNextDt().hashCode());
        result = prime * result + ((getRequestInfo() == null) ? 0 : getRequestInfo().hashCode());
        result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
        result = prime * result + ((getServerFlag() == null) ? 0 : getServerFlag().hashCode());
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getScheduledFireDt() == null) ? 0 : getScheduledFireDt().hashCode());
        result = prime * result + ((getRunTime() == null) ? 0 : getRunTime().hashCode());
        result = prime * result + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode());
        result = prime * result + ((getStatusName() == null) ? 0 : getStatusName().hashCode());
        result = prime * result + ((getDoDt() == null) ? 0 : getDoDt().hashCode());
        result = prime * result + ((getCompleteDt() == null) ? 0 : getCompleteDt().hashCode());
        result = prime * result + ((getResponseInfo() == null) ? 0 : getResponseInfo().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(","+super.toString());
        sb.append(", id=").append(id);
        sb.append(", triggerId=").append(triggerId);
        sb.append(", fireDt=").append(fireDt);
        sb.append(", previousDt=").append(previousDt);
        sb.append(", nextDt=").append(nextDt);
        sb.append(", requestInfo=").append(requestInfo);
        sb.append(", ip=").append(ip);
        sb.append(", serverFlag=").append(serverFlag);
        sb.append(", taskId=").append(taskId);
        sb.append(", scheduledFireDt=").append(scheduledFireDt);
        sb.append(", runTime=").append(runTime);
        sb.append(", statusCode=").append(statusCode);
        sb.append(", statusName=").append(statusName);
        sb.append(", doDt=").append(doDt);
        sb.append(", completeDt=").append(completeDt);
        sb.append(", responseInfo=").append(responseInfo);
        sb.append("]");
        return sb.toString();
    }

    /*************数据库列名start***********/
    /*************数据库列名end***********/
    public static final class Columns extends BaseColumns {
        /**
         * 字段名称映射<数据库字段名,属性名>
         */
        public static final Map<String, String> FIELD_MAP =  new HashMap<String,String>();

        /**
         * ID
         */
        public static final ColumnItem id = new ColumnItem("id","id");

        /**
         * 主键名称
         */
        public static final ColumnItem PK = new ColumnItem("id","id");

        /**
         * 上级
         */
        public static final ColumnItem triggerId = new ColumnItem("trigger_id","triggerId");

        /**
         * 修改人
         */
        public static final ColumnItem modUser = new ColumnItem("mod_user","modUser");

        /**
         * 修改人ID
         */
        public static final ColumnItem modUserId = new ColumnItem("mod_user_id","modUserId");

        /**
         * 修改时间
         */
        public static final ColumnItem modDt = new ColumnItem("mod_dt","modDt");

        /**
         * 创建人
         */
        public static final ColumnItem createUser = new ColumnItem("create_user","createUser");

        /**
         * 创建人ID
         */
        public static final ColumnItem createUserId = new ColumnItem("create_user_id","createUserId");

        /**
         * 创建时间
         */
        public static final ColumnItem createDt = new ColumnItem("create_dt","createDt");

        /**
         * 删除区分
         */
        public static final ColumnItem deleteClass = new ColumnItem("delete_class","deleteClass");

        /**
         * 有效区分
         */
        public static final ColumnItem validClass = new ColumnItem("valid_class","validClass");

        /**
         * 备注
         */
        public static final ColumnItem remark = new ColumnItem("remark","remark");

        public static final ColumnItem updateTs = new ColumnItem("update_ts","updateTs");

        /**
         * 时间戳
         */
        public static final ColumnItem insertTs = new ColumnItem("insert_ts","insertTs");

        /**
         * 是否能更新
         */
        public static final ColumnItem canUpdate = new ColumnItem("can_update","canUpdate");

        /**
         * 是否能删除
         */
        public static final ColumnItem canDelete = new ColumnItem("can_delete","canDelete");

        /**
         * 实际执行时间
         */
        public static final ColumnItem fireDt = new ColumnItem("fire_dt","fireDt");

        /**
         * 前一次实际执行时间
         */
        public static final ColumnItem previousDt = new ColumnItem("previous_dt","previousDt");

        /**
         * 下一次该执行时间
         */
        public static final ColumnItem nextDt = new ColumnItem("next_dt","nextDt");

        /**
         * 请求参数
         */
        public static final ColumnItem requestInfo = new ColumnItem("request_info","requestInfo");

        /**
         * 调用服务IP
         */
        public static final ColumnItem ip = new ColumnItem("ip","ip");

        /**
         * 调用服务标识
         */
        public static final ColumnItem serverFlag = new ColumnItem("server_flag","serverFlag");

        public static final ColumnItem taskId = new ColumnItem("task_id","taskId");

        /**
         * 计划执行时间
         */
        public static final ColumnItem scheduledFireDt = new ColumnItem("scheduled_fire_dt","scheduledFireDt");

        /**
         * 运行时间（毫秒）
         */
        public static final ColumnItem runTime = new ColumnItem("run_time","runTime");

        /**
         * 状态code
         */
        public static final ColumnItem statusCode = new ColumnItem("status_code","statusCode");

        /**
         * 状态
         */
        public static final ColumnItem statusName = new ColumnItem("status_name","statusName");

        /**
         * 执行时间
         */
        public static final ColumnItem doDt = new ColumnItem("do_dt","doDt");

        /**
         * 完成时间
         */
        public static final ColumnItem completeDt = new ColumnItem("complete_dt","completeDt");

        /**
         * 结果
         */
        public static final ColumnItem responseInfo = new ColumnItem("response_info","responseInfo");

        static {
            FIELD_MAP.put("id","id");
            FIELD_MAP.put("trigger_id","triggerId");
            FIELD_MAP.put("mod_user","modUser");
            FIELD_MAP.put("mod_user_id","modUserId");
            FIELD_MAP.put("mod_dt","modDt");
            FIELD_MAP.put("create_user","createUser");
            FIELD_MAP.put("create_user_id","createUserId");
            FIELD_MAP.put("create_dt","createDt");
            FIELD_MAP.put("delete_class","deleteClass");
            FIELD_MAP.put("valid_class","validClass");
            FIELD_MAP.put("remark","remark");
            FIELD_MAP.put("update_ts","updateTs");
            FIELD_MAP.put("insert_ts","insertTs");
            FIELD_MAP.put("can_update","canUpdate");
            FIELD_MAP.put("can_delete","canDelete");
            FIELD_MAP.put("fire_dt","fireDt");
            FIELD_MAP.put("previous_dt","previousDt");
            FIELD_MAP.put("next_dt","nextDt");
            FIELD_MAP.put("request_info","requestInfo");
            FIELD_MAP.put("ip","ip");
            FIELD_MAP.put("server_flag","serverFlag");
            FIELD_MAP.put("task_id","taskId");
            FIELD_MAP.put("scheduled_fire_dt","scheduledFireDt");
            FIELD_MAP.put("run_time","runTime");
            FIELD_MAP.put("status_code","statusCode");
            FIELD_MAP.put("status_name","statusName");
            FIELD_MAP.put("do_dt","doDt");
            FIELD_MAP.put("complete_dt","completeDt");
            FIELD_MAP.put("response_info","responseInfo");
        }
    }
}